﻿// 选择英雄

using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections;
using MotionFramework.UIKit;

namespace DemoProject
{
    public class SelectHeroForms : UIWindow
    {
        public Text TxtEnterGame;

        protected override void OnInit()
        {
            //本窗体状态
            //CurrentUIType.UIWindow_Type = SysDefine.UIWindowType.Normal;
            CurrentUIType.UIWindow_ShowMode = UIWindowShowMode.Normal;

            //事件注册
            AddClickEventListener("BtnOK", EnterMainUIForm);
            AddClickEventListener("ImgReturn", ()=>
            {
                CloseUIWindow<SelectHeroForms>();  
            });
        }//Awake_end

        #region  窗体生命周期
        protected override void OnEnter()
        {
            if (TxtEnterGame)
            {
                TxtEnterGame.text = ShowText("EnterGame");
            }
        }

        protected override void OnReEnter()
        {
            base.OnReEnter();
        }

        protected override void OnFreeze()
        {
            base.OnFreeze();
        }

        protected override void OnExit()
        {
            base.OnExit();
        }
        #endregion

        //进入游戏主窗体
        private void EnterMainUIForm()
        {
            ShowUIWindow(UIWindowID.MainForms.ToString());
            ShowUIWindow(UIWindowID.HeroInfo.ToString());
        }
    }//Class_end
}